import java.io.*;

public class Main {
    public static void main(String[] args) {
        File infile=new File("C:\\Users\\康鑫博\\Desktop\\java\\misson10\\src\\Main.txt");
        File outfile=new File("C:\\Users\\康鑫博\\Desktop\\java\\misson10\\src\\tf.txt");
        try {
            FileReader one=new FileReader(infile);
            BufferedReader two=new BufferedReader(one);
            FileWriter fw=new FileWriter(outfile);
            BufferedWriter bw=new BufferedWriter(fw);
            int i=0;
            String s=null;
            s=two.readLine();
            while (s!=null){
                i++;
                bw.write(i+" "+s);
                bw.newLine();
                s=two.readLine();
            }
            one.close();
            two.close();
            bw.flush();
            bw.close();
            fw.close();
        }
        catch (IOException e){
            System.out.println("ERROR");
        }
    }
}